package jehc.cloud.gen.service.impl;

import jehc.cloud.common.base.BaseService;
import jehc.cloud.common.util.ExceptionUtil;
import jehc.cloud.gen.dao.XtScriptDao;
import jehc.cloud.gen.model.XtScript;
import jehc.cloud.gen.dao.XtScriptDao;
import jehc.cloud.gen.model.XtScript;
import jehc.cloud.gen.service.XtScriptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * @Desc 平台脚本
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service("xtScriptService")
public class XtScriptServiceImpl extends BaseService implements XtScriptService {
	@Autowired
	private XtScriptDao xtScriptDao;
	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<XtScript> getXtScriptListByCondition(Map<String,Object> condition){
		try{
			return xtScriptDao.getXtScriptListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param xt_script_id 
	* @return
	*/
	public XtScript getXtScriptById(String xt_script_id){
		try{
			return xtScriptDao.getXtScriptById(xt_script_id);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 添加
	* @param xtScript
	* @return
	*/
	public int addXtScript(XtScript xtScript){
		int i = 0;
		try {
			i = xtScriptDao.addXtScript(xtScript);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 修改
	* @param xtScript
	* @return
	*/
	public int updateXtScript(XtScript xtScript){
		int i = 0;
		try {
			i = xtScriptDao.updateXtScript(xtScript);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delXtScript(Map<String,Object> condition){
		int i = 0;
		try {
			i = xtScriptDao.delXtScript(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
